# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BackupDR.V1.Model.AttachedDisk do
  @moduledoc """
  An instance-attached disk resource.

  ## Attributes

  *   `autoDelete` (*type:* `boolean()`, *default:* `nil`) - Optional. Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
  *   `boot` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
  *   `deviceName` (*type:* `String.t`, *default:* `nil`) - Optional. This is used as an identifier for the disks. This is the unique name has to provided to modify disk parameters like disk_name and replica_zones (in case of RePDs)
  *   `diskEncryptionKey` (*type:* `GoogleApi.BackupDR.V1.Model.CustomerEncryptionKey.t`, *default:* `nil`) - Optional. Encrypts or decrypts a disk using a customer-supplied encryption key.
  *   `diskInterface` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies the disk interface to use for attaching this disk.
  *   `diskSizeGb` (*type:* `String.t`, *default:* `nil`) - Optional. The size of the disk in GB.
  *   `diskType` (*type:* `String.t`, *default:* `nil`) - Optional. Output only. The URI of the disk type resource. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
  *   `diskTypeDeprecated` (*type:* `String.t`, *default:* `nil`) - Specifies the type of the disk.
  *   `guestOsFeature` (*type:* `list(GoogleApi.BackupDR.V1.Model.GuestOsFeature.t)`, *default:* `nil`) - Optional. A list of features to enable on the guest operating system. Applicable only for bootable images.
  *   `index` (*type:* `String.t`, *default:* `nil`) - Optional. A zero-based index to this disk, where 0 is reserved for the boot disk.
  *   `initializeParams` (*type:* `GoogleApi.BackupDR.V1.Model.InitializeParams.t`, *default:* `nil`) - Optional. Specifies the parameters to initialize this disk.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Optional. Type of the resource.
  *   `license` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Any valid publicly visible licenses.
  *   `mode` (*type:* `String.t`, *default:* `nil`) - Optional. The mode in which to attach this disk.
  *   `savedState` (*type:* `String.t`, *default:* `nil`) - Optional. Output only. The state of the disk.
  *   `source` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies a valid partial or full URL to an existing Persistent Disk resource.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies the type of the disk.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoDelete => boolean() | nil,
          :boot => boolean() | nil,
          :deviceName => String.t() | nil,
          :diskEncryptionKey => GoogleApi.BackupDR.V1.Model.CustomerEncryptionKey.t() | nil,
          :diskInterface => String.t() | nil,
          :diskSizeGb => String.t() | nil,
          :diskType => String.t() | nil,
          :diskTypeDeprecated => String.t() | nil,
          :guestOsFeature => list(GoogleApi.BackupDR.V1.Model.GuestOsFeature.t()) | nil,
          :index => String.t() | nil,
          :initializeParams => GoogleApi.BackupDR.V1.Model.InitializeParams.t() | nil,
          :kind => String.t() | nil,
          :license => list(String.t()) | nil,
          :mode => String.t() | nil,
          :savedState => String.t() | nil,
          :source => String.t() | nil,
          :type => String.t() | nil
        }

  field(:autoDelete)
  field(:boot)
  field(:deviceName)
  field(:diskEncryptionKey, as: GoogleApi.BackupDR.V1.Model.CustomerEncryptionKey)
  field(:diskInterface)
  field(:diskSizeGb)
  field(:diskType)
  field(:diskTypeDeprecated)
  field(:guestOsFeature, as: GoogleApi.BackupDR.V1.Model.GuestOsFeature, type: :list)
  field(:index)
  field(:initializeParams, as: GoogleApi.BackupDR.V1.Model.InitializeParams)
  field(:kind)
  field(:license, type: :list)
  field(:mode)
  field(:savedState)
  field(:source)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.BackupDR.V1.Model.AttachedDisk do
  def decode(value, options) do
    GoogleApi.BackupDR.V1.Model.AttachedDisk.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BackupDR.V1.Model.AttachedDisk do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
